JLabel fatLabel with JTextField inFat JLabel calLabel with JTextField inCal JLabel perLabel with JTextField outPer
JPanel
The idea is to have three panels, one for each pair of label and text field. The lone title at the top and the button at the bottom do not need to be placed in panels. The picture shows this grouping. (The lines showing the panels do not actually appear.)
The add()
method places components in a panel.
Each panel needs a layout manager.
This program uses the default layout manager, FlowLayout
, for each panel.
Fill in the blanks by clicking the buttons. Think a little, first.